import request from '@/util/request'


// 登录
export function login(data) {
    return request({
        url: '/user/login',
        method: 'post',
        data
    })
}

// 注册
export function register(data) {
    return request({
        url: '/user/register',
        method: 'post',
        data
    })
}

// 重置密码
export function forgetPassword(data) {
    return request({
        url: '/user/forgot',
        method: 'post',
        data
    })
}

// 发送验证码
export function sendCode(email) {
    return request({
        url: `/user/sendCode?email=${email}`,
        method: 'get'
    })
}

// 获取用户信息
export function getUserInfo() {
    return request({
        url: '/user/info',
        method: 'get'
    })
}

// 退出登录
export function logout() {
    return request({
        url: '/user/logout',
        method: 'get'
    })
}